<?php  namespace Home\Controller;
use Hdphp\Controller\Controller;
class ContentController extends Controller{
	
	public function index(){
//		获得顶级分类
		$cdata=new \Common\Model\Cate;
		$cdata=$cdata->get();
		View::with('cdata',$cdata);
//		p($cdata);die;
		
		$gid=Q('get.gid',0,'intval');
		$gdata=new \Common\Model\Goods;
		$gdata=$gdata->where("gid={$gid}")->get();
		View::with('gdata',$gdata);
//		p($gdata);die;
		$gsdata=new \Common\Model\Goodssx;
		$gsdata=$gsdata->join('nature','nature_nid','=','nid')->where("goods_gid={$gid} and natype='0'")->get();
		View::with('gsdata',$gsdata);
//		获得颜色尺码
		$shuxing=array();
		foreach ($gsdata as $k => $v) {
			$shuxing[$v['nature_nid']][]=$v;
			
		}
//		p($shuxing);die;
		View::with('shuxing',$shuxing);
//		p($shuxing);
		
		View::make();
	}
	
} 
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
?>